package com.zkx.laolaiyi.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zkx.laolaiyi.handler.AESEncryptHandler;
import jakarta.servlet.annotation.HandlesTypes;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;

/**
 * 用户类
 */
@Data
@TableName(value = "t_user", autoResultMap = true)
//@TableName("t_user")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class User {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private Long uid;

    @TableField(value = "username", typeHandler = AESEncryptHandler.class)
    private String username;
    @TableField(typeHandler = AESEncryptHandler.class)
    private String nickname;

    @TableField(value = "password", typeHandler = AESEncryptHandler.class)
    private String password;

    @TableField(value = "phone", typeHandler = AESEncryptHandler.class)
    private String phone;

    private String avatar;

    private Character status;

    @JsonIgnore
    private LocalDateTime createTime;

    @JsonIgnore
    private LocalDateTime updateTime;

    @JsonIgnore
    private Long createUser;

    @JsonIgnore
    private Long updateUser;
}
